package org.luxor.commons.core.utils;

import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

/**
 * 全球唯一识别
 *
 * @author Mr.yan @date 2019/9/28
 */
public class UuidUtils {

    public static String uuid() {
        ThreadLocalRandom random = ThreadLocalRandom.current();
        return new UUID(random.nextLong(), random.nextLong()).toString();
    }

    /**
     * 返回无'-'符号的UUID
     *
     * @return java.lang.String
     */
    public static String uuid32() {
        return uuid().replace(StrKit.DASH, StrKit.EMPTY);
    }
}

